package hxy.bytecode.git;

import com.jcraft.jsch.JSch;
import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session;
import org.eclipse.jgit.transport.JschConfigSessionFactory;
import org.eclipse.jgit.transport.OpenSshConfig;
import org.eclipse.jgit.util.FS;

import java.io.ByteArrayInputStream;
import java.io.InputStream;

/**
 * @author eric
 * @program bytecode
 * @description
 * @date 2020/3/4
 */
public class CtSshSessionFactory extends JschConfigSessionFactory {

    CtSshSessionFactory(String privateKey, String knowHost) {

    }

    CtSshSessionFactory() {

    }

    @Override
    protected void configure(OpenSshConfig.Host host, Session session) {
        session.setConfig("StrictHostKeyChecking", "no");
    }

    @Override
    protected JSch createDefaultJSch(FS fs) throws JSchException {
        JSch jSch = super.createDefaultJSch(fs);
        String prvkeyStr = "-----BEGIN RSA PRIVATE KEY-----\n" +
                "MIIEpAIBAAKCAQEAsab/Egk9M0GHSZE4UF4BNxfNufRaFTxHF19BmKt3RVtfdIbb\n" +
                "0xjvFrgx7sYFJgBPsPvM00zcwIIWWIRBwZFqhvH9pLStTzIy8j2PJ/cIn2V1q4A1\n" +
                "W8it8g4F/WAhlHl6w6ESM0Ixz1dKjuiV73bjEajviMxuCm9DfpIuBpWGIgXagLRA\n" +
                "ak/cpUK5s/4aqTbP+1TdYp/i7jPB+LAxr3lSpHPM7llgS/lsl9Vnw+FJOe+jiDLU\n" +
                "imXOL9t2forcSxhB3lfQ+2tTpE2Nuq/nBBrfeTjmi3KJC7FVKou2F/oCwpmU8ann\n" +
                "44OjPgJeIRKCMsXpU3fcPth9H7gdSz52K5eNAwIDAQABAoIBAQCFcMXJe20f8gm3\n" +
                "xcACBgptopCiLBv6NXPE54UzMyB81VyG/8Fg+Cqm6yZ+jvlRCQzTCOBamzJ5230D\n" +
                "chyeVCcrQ9vc+uXvReqksH62a0VrzV8sujnaPowB9GylXK78gp8nEPbFz+PwNUZI\n" +
                "wAXXgHqhSj7ah4vkhJyzFwRBZ9D//hsz8sZVkYqmrawPlfjGfEx3PigZjoT0n47d\n" +
                "sd/Qwf2yVgKdq/14IlUs/2pbmTnx7mP4IqtEz0t+ox83VA3NDZp715ai3xXfLzFR\n" +
                "X6JMA6SNvh3whgR6oQo0xvGmowVwLhHqS5ig3J+RrK+TTd3YEdf7zHel3RTG2hqG\n" +
                "1ZtDAFjpAoGBANe6g+PQ1u2GdTJSQkCJlme3o7pOdLTSfTWCnfiPSPi3rYk/NncF\n" +
                "tfS9hGjendsng8YljcnTQDQa393kOqcGAOzMOxImDbi5xBpFJRtzz9lOY4+MhTm7\n" +
                "h7ZXtK1x+1iArG8T4s9JCXElcm4v7BhGW/6uShhA1dLY26gSbY6QocDVAoGBANLQ\n" +
                "2Y92esTHDLW3SmNMGZpSFVokYAYdz7X62V6nWnoyZh/4LZJBbEopDshJPkNdj2ZN\n" +
                "ywCubZbjp2BdA8ryexAQeUoLtL/iZzV/qD3VdWuEEEG9CxpWqQ6YwYXQU+YyPpiX\n" +
                "JKwm5aze33c1qGWeLjnkCJyToeniGqRtIEsh8EJ3AoGBAJ7VsBgDgsvd7NpBIJCd\n" +
                "/QSefElHTLx6IkBMzHzfGq4tpvLffP2DUeZBx4TjK7zZSjeRHOVVyfbTNrMMQHcL\n" +
                "f5DaCkAhjobNF+rzsA+XZJiuE7X0k37faVvDFb+CpboS+2LJdHyEXRRWqvsgA6gX\n" +
                "3dIVh252Bjk4+/myn8GREdeFAoGAdhcFd6ZvmODDTtswcTUEtnw6d7ceju6OFqtA\n" +
                "rhPiy8aFjGzx4haBuX0MScc1eHjlRfJXv7b1rmsxq/oOkNWJd/MybfbmtgH1vHMY\n" +
                "5CI5VxOwI5LosEVRB9srtHCBPtZwV/t6UHCtgUuLM/S7ssiLrmP9KvBL535/XBHA\n" +
                "4DVPp3sCgYAwGNkgtBomrL42Aj5yC+DaiDTX/zQAXFG6CVjr4h/TPr5r13gr7g4/\n" +
                "dLt8zx6Ag7aMZSYsfd2fIrQWcX41fD/i4Ao3Z7yoyTrOEYf9KEPNHPiB/4ZsxlAc\n" +
                "8HAvVpc+RqHEUyuOQTtci6rBjZDSpePrBT5PFfMrJX1vuw+j1xwE8A==\n" +
                "-----END RSA PRIVATE KEY-----\n";


        byte[] prvkey = prvkeyStr.getBytes();
        byte[] pubkey = null;
        byte[] passphrase = null;

        String knownHosts = "|1|3xP5HeKE6A3hLblqDPsDD+YClvU=|MMElf/E+N9P4y0bDEe98sbAZP6k= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBN5+2qtQ5fMYIAKFaDcPvDjShN7rWqwwp+kTlNkigxYhoYcht8Qi5xuQ7wlf5Z7otOHCHUfN/1WgN53pvC6lA94=\n" +
                "|1|jRdBTIfp8y3SCwOhrhPJ4m8/2qE=|6Ov5lBi+7R0Kie+xOVBkrnDFGxc= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==\n" +
                "|1|X/4x44DqqbjAfaqr/feD+MTXiXw=|DDfi2f9E4ksvo7XhET4HlamUpwE= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==\n" +
                "|1|F86jiQRDQ3sMRxcQVclHv83gSz4=|OBz4v+c+VumUKoJ3ItUjR+Sb/v4= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBM09Ibe9kvj7q1rtpFRXBpqPBYRoDEFz/prY+7bGWlAdOHGd3Dz9MdDtsTUs+xBfvSubyWpW/aYYsijoY6yOfXU=\n" +
                "|1|bdEYrK2ho1ofY5DK8xZzxF37P4o=|CBMIbHinQC6A2rQl/pTVVHeGpFg= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==\n" +
                "|1|EvWvV8E0EZv8oTx7aa2G1AIJjq8=|xNnHY6KAw1EKphE/4eWu04n83gg= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBM09Ibe9kvj7q1rtpFRXBpqPBYRoDEFz/prY+7bGWlAdOHGd3Dz9MdDtsTUs+xBfvSubyWpW/aYYsijoY6yOfXU=\n" +
                "|1|iLftrj8AZ54ajyHxhSnulHQq8oY=|YrT/tu9ZiByn9e3MVF5UN5nd6sA= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA1NcUmQj+VZrqs4dN5VK2nC3IYo49HgK81SGlkcIpRFAOgCqESOWimw8ABKaFVRcYi2iNoPKn50CkNItNhitO00pN1wE1eyoYb2YaPtnvCI0DXQtS2qxbwuz+w9xyCS93ovwk9vf4pStiEwkCohnhzSI34oJ4TI6WDVGtmeJWA6I/Cakn53WFiAXqxOtE7QArbI+6jqfomFDOSQLZXPdgoJbTU468abnc2XznmzRFrKc9wjh6iOI4lY+KVadmGR/8jf3w0nvDHHylEs98ilm3IQWPJxj6RR4deLUj6cJNF4bQNI+cAOrGVBuY4ZQvu9ORfJqiAOi03SIUsff26YNKPw==\n" +
                "|1|P9QWvFMmOn6usDLraIlgvYqB6bc=|/sXKbfXNERkZ8jyaGTfGzzLd9b0= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBI23D3uZsrfF6zDtVEk3auT2oaOz+MDS+tbqVSrS1uDBYkwDcwybQSR7NpfPueKOfxk9Wy0OQp3pwidBUzSc+fc=\n" +
                "|1|8tyWj8p3OA/vT/IMMo9rij6MYPQ=|8Wb3IjNkfNNI0crHTF1nikYPslw= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBM09Ibe9kvj7q1rtpFRXBpqPBYRoDEFz/prY+7bGWlAdOHGd3Dz9MdDtsTUs+xBfvSubyWpW/aYYsijoY6yOfXU=\n" +
                "|1|hFdnjIBs7a3aOetN5m8DEtcXNLI=|UlzE1GMpQs7bC6g7eT1i0enNy+o= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBM09Ibe9kvj7q1rtpFRXBpqPBYRoDEFz/prY+7bGWlAdOHGd3Dz9MdDtsTUs+xBfvSubyWpW/aYYsijoY6yOfXU=\n" +
                "|1|CZPIlu5zeEqYQFozXCehkjgJjfs=|THp2Kxrx7X6xe4/KRJ3HJ65Emk4= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBM09Ibe9kvj7q1rtpFRXBpqPBYRoDEFz/prY+7bGWlAdOHGd3Dz9MdDtsTUs+xBfvSubyWpW/aYYsijoY6yOfXU=\n" +
                "|1|fndlTJy6ESd1D+fAl8NWZjP8YpQ=|q5fX1/ne74A58yp0EgnaQ6S0080= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBM09Ibe9kvj7q1rtpFRXBpqPBYRoDEFz/prY+7bGWlAdOHGd3Dz9MdDtsTUs+xBfvSubyWpW/aYYsijoY6yOfXU=\n" +
                "|1|96syx2YR4xVGKOuQYRNrFaMJxx0=|49yrweV7sFbRjTvgDGWFtnucQM4= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBM09Ibe9kvj7q1rtpFRXBpqPBYRoDEFz/prY+7bGWlAdOHGd3Dz9MdDtsTUs+xBfvSubyWpW/aYYsijoY6yOfXU=\n" +
                "|1|zkxYRb0fT0+m3H8r485qL3TzSNY=|On3hltYBIaKsjktHAO73BaQR7DY= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==\n" +
                "|1|bO+FuJ1eximbJurvJkxWFIY0WA8=|IAKqP76rN7b3QFpxQPAsLr1kaeg= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBM09Ibe9kvj7q1rtpFRXBpqPBYRoDEFz/prY+7bGWlAdOHGd3Dz9MdDtsTUs+xBfvSubyWpW/aYYsijoY6yOfXU=\n" +
                "|1|62IYH5kn3ZzbgSoFPGQ4xbSpTWU=|xRJS5T7tQWEVoHSLerJBNCSNN10= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBM09Ibe9kvj7q1rtpFRXBpqPBYRoDEFz/prY+7bGWlAdOHGd3Dz9MdDtsTUs+xBfvSubyWpW/aYYsijoY6yOfXU=\n" +
                "|1|oslP3iQQnHbAW9mPcMCZeKwbFZA=|aPptMaWcjPpG3XeTquKgzEsnsRQ= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBM09Ibe9kvj7q1rtpFRXBpqPBYRoDEFz/prY+7bGWlAdOHGd3Dz9MdDtsTUs+xBfvSubyWpW/aYYsijoY6yOfXU=\n" +
                "172.31.102.151 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDSg3eCLAoLj7WFx7432jvPlIlXKoJDNrd15DRXeu09T+hVbBm9byG0H955Mb8PBnovl7LV2IBlrHhgNTw7eOMUhsQxxE8JkCGV1rzs2ox7jQxMpLOO61+PxK91h/HGqmp+NBwwiNaJvE3+m6y7qEJPLQnRyOc4JmtqNRab5XV8cgdDoTf6mqVah9lmXTRWUEexOoeK1Yar/pgwZJP2dHP7ueLeMy0dvJugYo2J1Q9JQvgoYp+37iFM+EB4XVVyXKZice0qtrgek6nYzg+794s44104Ob2aKwwsyZsLkebb4qlxEPdaE73fDJ4ZMLaacN3b8WWkhnr74T6jEcsS08/\n" +
                "|1|JSDkQ/JTwvP09k3c/NQJydXDp/o=|vYWPrUbo433qhO5WRbUJR5Ac10k= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBM09Ibe9kvj7q1rtpFRXBpqPBYRoDEFz/prY+7bGWlAdOHGd3Dz9MdDtsTUs+xBfvSubyWpW/aYYsijoY6yOfXU=\n" +
                "172.31.102.207 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDSg3eCLAoLj7WFx7432jvPlIlXKoJDNrd15DRXeu09T+hVbBm9byG0H955Mb8PBnovl7LV2IBlrHhgNTw7eOMUhsQxxE8JkCGV1rzs2ox7jQxMpLOO61+PxK91h/HGqmp+NBwwiNaJvE3+m6y7qEJPLQnRyOc4JmtqNRab5XV8cgdDoTf6mqVah9lmXTRWUEexOoeK1Yar/pgwZJP2dHP7ueLeMy0dvJugYo2J1Q9JQvgoYp+37iFM+EB4XVVyXKZice0qtrgek6nYzg+794s44104Ob2aKwwsyZsLkebb4qlxEPdaE73fDJ4ZMLaacN3b8WWkhnr74T6jEcsS08/\n" +
                "|1|rJ24j3nhcAt6DsHBAM7yE8EOcMc=|fpOqsqD1I2XRNzT8Ald88OUZmp0= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMuEoYdx6to5oxR60IWj8uoe1aI0X1fKOHWOtLqTg1tsLT1iFwXV5JmFjU46EzeMBV/6EmI1uaRI6HiEPtPtJHE=\n" +
                "|1|ATYwlKDUZc17q5J+46Qrff3/8t4=|Uy6RExb/Vb8kfQiViVrPsL0Pj9A= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMuEoYdx6to5oxR60IWj8uoe1aI0X1fKOHWOtLqTg1tsLT1iFwXV5JmFjU46EzeMBV/6EmI1uaRI6HiEPtPtJHE=\n" +
                "gitee.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDMzG3r+88lWSDK9fyjcZmYsWGDBDmGoAasKMAmjoFloGt9HRQX2Qp4f9FY2XK/hsHYinvoh5Xytl9iaUNUWMfYR8q6VEMtOO87DgoAFcfKZHt0/nbAg9RoNTKYt6v8tPwYpr7N0JP/01nE4LFsNDnstr6H0bXSAzbKWCETLZfdPV4l2uSpRn3bU0ugoZ0aSKz5Dc/IloBfGCTvkSsxUydMRd/Chpjt6VxncDbp+Fa6pzsseK8OQzrg6Fgc5783EN3EQqZ2skqyCwExtx95BJlfx1B3luZnWfpkwNDnrZRT/Qx0OrWqyf0q6f9uQr+UG1S8qDcUn3e/9onq3rwBri8/\n" +
                "|1|O4teq5iDB6L5ZSQO4RUm6an4Cqs=|xgqxbfqiOIUy7ymossGEvQE35fk= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBArzLf9mAHdzRCzm9FPu5fZw3W2D7hvz7lnQxAaNKU44589jB45WW0PNG5qopT34NqB98R0kXRu/Oi3yB+h33jg=\n" +
                "|1|BsrxOLs6QSdk5LLtibDwoUHPmO4=|WNHUTdYyqQsMQw4m7B4nrLUQwBY= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBM09Ibe9kvj7q1rtpFRXBpqPBYRoDEFz/prY+7bGWlAdOHGd3Dz9MdDtsTUs+xBfvSubyWpW/aYYsijoY6yOfXU=\n" +
                "|1|x53YQznqLiuhyk1skbtobpOGIKI=|OWQwac1SGyYXeQ1O4mRv6WUl5gI= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMuEoYdx6to5oxR60IWj8uoe1aI0X1fKOHWOtLqTg1tsLT1iFwXV5JmFjU46EzeMBV/6EmI1uaRI6HiEPtPtJHE=\n" +
                "|1|wSAPVQrben1qf3RXqiNkzMJ7E7g=|jbIIgCvVuptnoQVHohTfNIYMluc= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBI23D3uZsrfF6zDtVEk3auT2oaOz+MDS+tbqVSrS1uDBYkwDcwybQSR7NpfPueKOfxk9Wy0OQp3pwidBUzSc+fc=\n" +
                "|1|kJTQPCY1DxDp3A8IZWORL+s8B9k=|8JnFrKbHPKZzNxWbHzj45h7egbM= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBI23D3uZsrfF6zDtVEk3auT2oaOz+MDS+tbqVSrS1uDBYkwDcwybQSR7NpfPueKOfxk9Wy0OQp3pwidBUzSc+fc=\n" +
                "|1|Hzt6t9kP2q/vq9cpYtRvvuVQXOI=|HtBZej1AX/uehkd9hHqVrWpckRM= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBM09Ibe9kvj7q1rtpFRXBpqPBYRoDEFz/prY+7bGWlAdOHGd3Dz9MdDtsTUs+xBfvSubyWpW/aYYsijoY6yOfXU=\n" +
                "|1|x9C581xwafeX4kXjQxT8tqtZlwk=|4voAVFTJVt0nWVQiespITM4h2ZE= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBM09Ibe9kvj7q1rtpFRXBpqPBYRoDEFz/prY+7bGWlAdOHGd3Dz9MdDtsTUs+xBfvSubyWpW/aYYsijoY6yOfXU=\n" +
                "|1|kMwluCX8WavF8OfATi4ndgsunrA=|xQDzoH7W3xNc104Alsj2Emmu9Pw= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMuEoYdx6to5oxR60IWj8uoe1aI0X1fKOHWOtLqTg1tsLT1iFwXV5JmFjU46EzeMBV/6EmI1uaRI6HiEPtPtJHE=";
        InputStream inputStream = new ByteArrayInputStream(knownHosts.getBytes());


//        jSch.addIdentity("/home/eric/.ssh/id_rsa");
        jSch.addIdentity("name", prvkey, pubkey, passphrase);
//        jSch.setKnownHosts("/home/eric/.ssh/known_hosts");
        jSch.setKnownHosts(inputStream);

        return jSch;
    }
}
